<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>GMAIL ADDRESS BOOK EXPORTER</title>
</head>

<body>
<style>
<!--

p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt }
h2 { color: #ff9900; font-weight: bold; }
H2 { font-size: 13pt; }
-->
</style>

<h2 align="center"><font color="#000000">GMAIL ADDRESS BOOK EXPORTER</font></h2>
<h2><font color="#000000">Introduction</font></h2>
<p>Gmail is cool enough to add all the addresses you get in touch with, to your 
address book. So you really tend to accumulate an exhaustive list of contacts. 
You hardly have the need to open up the contact list, owing to the auto-complete 
feature of gmail. However, what if you want to import the whole list into some 
mail client program, or another web email provider? This utility will let you do 
a flexible export of your gmail contact list to a text file. You can choose what 
fields to export, what (and how many) characters will separate the fields and 
specify rules to filter the exact addresses you want. To put it in more 
practical sentences, you can have something like &quot;Export the fields Name, Email 
and Notes and separate the fields with 3 comma characters&quot; and &quot;Export all the 
contacts whose email address ends with yahoo.com&quot;. As of now, this export 
feature is not available in gmail. Even if it is introduced later, this utility 
has quite a few features that will save you from writing a perl script to 
re-organize the export file the way you want. </p>
<h2><font color="#000000">Acknowledgement</font></h2>
<p>This code uses <a href="http://g4j.sourceforge.net/">g4j - Gmail API for Java</a> 
to communicate with gmail. </p>
<h2><font color="#000000">Using the code</font></h2>
<p>Extract the gexporter.zip file. You should see 3 folders - </p>
<p>1) src (contains the source code)<br>
2) classes (contains the class files in proper package structure)<br>
3) lib (contains g4j-lib.jar) </p>
<p>Along with these, you should also see the html file which contains what you 
are reading now, and some screen shots to show you how the utility looks.</p>
<p><font size="3">Attention - Read steps 1 and 2 below carefully if your JRE version is lesser 
than 1.5! If your version is at least 1.5, you can go to step 3 directly.</font></p>
<p>There is a small catch with this g4j API. You'll run into a certificate 
problem when you run the code with anything lesser than jre 1.5. Unfortunately, 
I had a lower version. Fortunately, there is a work-around. You just have to do 
it once, and you are done. Follow the steps below - </p>
<p>1) Getting the gmail server certificate - open https://gmail.google.com in 
Internet Explorer, double click the lock icon in the right corner of the status 
bar to open certificate, go to Details tab, press Copy to File, select X.509 
binary DER) and save it in a file (say gm.cer). I'm not sure how to do this 
certificate business with Netscape, so please figure it out yourself if you are 
a Netscape user.</p>
<p>2) Importing the certificate - run the following command </p>
<pre>d:\jdk141\bin\keytool -keystore d:/jdk141/jre/lib/security/cacerts -import -file d:\gm.cer -alias gmail
</pre>
<p>Make sure you change the location of jre and the certificate file path (the 
one you just saved) to the path on your machine.</p>
<p>3) If you are done with this, nothing should stop you from using the utility. 
Get into the 'classes' folder and run the command </p>
<p></p>
<pre>d:\jdk141\bin\java -cp .;..\lib\g4j-lib.jar vkarthik.gtools.gexport.GExporter</pre>
<p>There you go, you can figure out the rest. Unix users, please change the 
classpath separator from ';' to ':'. 

<p><b>Note</b>:<p>1) I have tested this on JRE 1.5 (and Windows XP) and 1.4.1 
(and Windows 2000). 

<p>2) The tool will store your preferences (the values you enter while you are 
using the tool) in a file called preferences.dat. Though this is binary, your 
login and password will be clear text. You may want to delete this file before 
letting others use your computer.<h2><font color="#000000">Understanding the code</font></h2>
<font face="Verdana" size="2">I used a freeware Java GUI designer to make the UI, so don't expect much clarity in the 
UI code. But the design of the utility 
should be easy to understand, it resembles the MVC pattern. The core work is 
done by the class GExporter, so go through that if you want to understand what 
is happening.</font><p>For those who didn't understand the code - don't worry! 
The utility as such should be useful.</p>
<p><b>If you found this utility good, don't forget to cast a vote for me.</b></p>
</p>

</body>

</html>